{% extends "base.volt" %}
{% block pageFooter%}
{{ javascript_include("/assets/manage/js/question/hotlist.js", false) }}
{% endblock %}
{% block content %}
    {{ partial("module/left_question") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li><a href="{{ url.get('question/list') }}">问答</a></li>
            <li><a href="{{ url.get('question/list') }}">问答管理</a></li>
            <li class="active">搜索热词</li>
        </ol>
    <div style="clear:both;"></div>
        <div class="panel panel-default">
            <div class="panel-body">
                <form class="form-inline" role="form" action="" method="get">
                   
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon" for="keyword">热词:</label>
                            <input class="form-control" type="text" name="keyword" id="keyword" value="{{ keyword }}" />
                        </div>  
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon" for="filterUser">状态:</label>
                            <select name="status" class="form-control">
                            	<option value="" {% if state == '' %} selected='selected' {% endif %}>全部</option>
                            	<option value="1" {% if state == '1' %} selected='selected' {% endif %}>正常</option>
                            	<option value="0" {% if state == '0' %} selected='selected' {% endif %}>删除</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 搜 索</button>
                    </div>
                </form>
            </div>
        </div>

        <table class="table table-hover">
            <thead>
            <tr>
                <th style="width: 60px;">ID</th>
                <th style="width: 100px;">热词</th>
                <th style="width: 80px;">状态</th>
                <th style="width: 120px;"></th>
            </tr>
            </thead>
            {% for d in list %}
                <tr>
                    <td>{{ d['id'] }}</td>
                    <td>{{ d['title'] }}</td>
                    <td>{{ d['status'] == 1 ? '正常' : '删除'}}</td>
                    <td>
                        <div class="dropdown">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu{{ d['id'] }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><i class="fa fa-cogs"></i> 操作 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu{{ d['id'] }}">
                                <li><a href="{{ url.get('question/hotedit') }}?id={{ d['id'] }}" ><i class="fa fa-pencil fa-fw"></i> 编辑</a></li>
                                {% if d['status'] == 1 %}
                                <li><a href="javascript:void(0);" class="changeState" dstate='0' durl='{{ url.get("question/changestate")}}?id={{d["id"]}}&state=0'><i class="fa fa-trash fa-fw"></i> 删除</a></li>
                                {% else %}
                                <li><a href="javascript:void(0);" class="changeState" dstate='1' durl='{{ url.get("question/changestate")}}?id={{d["id"]}}&state=1'><i class="fa fa-share fa-fw"></i> 恢复</a></li>
                                {% endif %}
                            </ul>
                        </div>
                    </td>
                </tr>
            {% endfor %}
        </table>

        {{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('question/list', [
            'qcontent': qcontent,
            'filterState': filterState,
            'filterUser': filterUser,
            'qcontent' : qcontent,
            'qtag' : filtertag,
            'inputtime' : inputtime,
            'page': '__PAGE__'
        ]
        )) }}
    </div>
{% endblock %}